using UnityEngine;

//随机修改颜色
public class RandomColor : MonoBehaviour
{
    private Renderer cubeRenderer;

    void Start()
    {
        cubeRenderer = GetComponent<Renderer>();
        ChangeColor();
    }

    void ChangeColor()
    {
        Color randomColor = new Color(Random.value, Random.value, Random.value);
        cubeRenderer.material.color = randomColor;
    }
}
